<template>
  <div ref="gantt" style="width: 100%; height: 500px; position: relative;"></div>
</template>

<script>
import gantt from "dhtmlx-gantt";
import "dhtmlx-gantt/codebase/dhtmlxgantt.css";

export default {
  mounted() {
    gantt.config.xml_date = "%Y-%m-%d"; // 关键：设置日期格式
    gantt.config.row_height = 35;
    gantt.config.bar_height = 35;
    gantt.init(this.$refs.gantt);

    gantt.parse({
      data: [
        { id: 1, text: "Task #1", start_date: "2025-07-11", duration: 5, progress: 0.5 }
      ]
    });
  }
};
</script>
<style scoped>
::v-deep .gantt_task_line{
  top:-35px !important;
}
</style>
